<?php
OCP\JSON::checkLoggedIn();
OCP\JSON::callCheck();

$app = PFactory::getApplication();

$orderby = JRequest::getString('orderby', '');
$orderdir = JRequest::getString('orderdir', '');
if(!empty($orderby) && !empty($orderdir)) {
   $orderdir = ($orderdir == 'ASC' ? 'DESC' : 'ASC');
   $calendarlistdir['orderby'] = $orderby;
   $calendarlistdir['orderdir'] = $orderdir; 
   $app->setUserState('calendarlistdir', $calendarlistdir);
   OC_JSON::success(array("data" =>array()));
}
